<?php

class IndexAction extends Action
{

    /**
     * IndexAction::index()
     * 
     * @return
     */
    public function index()
    {

	    $this->display('Index:index');
    }

    /**
     * IndexAction::s()
     * 
     * @return
     */
    public function s()
    {
		if (isset($_GET['wd']))
		{
			$this->assign('sword', $_GET['wd']);
			//$result = getUrl($_GET['wd']);
			$result = 'ok';
			$this->assign('rt', $result);
			$this->display('jump');
		}
    }
    //产生验证码
    /**
     * IndexAction::verify()
     * 
     * @return
     */
    public function verify()
    {
	import("ORG.Util.Image");
	import("ORG.Util.String");
    Image::buildImageVerify();
    }		
	
	    /**
	     * IndexAction::about()
	     * 
	     * @return
	     */
	    public function about()
    {
	    $this->display('Index:about');
    }

	    /**
	     * IndexAction::reg()
	     * 
	     * @return
	     */
	    public function reg()
    {
			$this->assign('refer', $_GET['refer']);	
	    $this->display('AuthACL:reg');
    }	

	    /**
	     * IndexAction::set()
	     * 
	     * @return
	     */
	    public function set()
    {
			$this->assign('refer', $_GET['refer']);	
	    $this->display('Index:set');
    }	
	
	    /**
	     * IndexAction::login()
	     * 
	     * @return
	     */
	    public function login()
    {
		if(isset( $_GET['refer']))
		$this->assign('refer', $_GET['refer']);	
	    $this->display('AuthACL:login');
    }	
	    /**
	     * IndexAction::duty()
	     * 
	     * @return
	     */
	    public function duty()
    {
			$this->assign('refer', $_GET['refer']);	
	    $this->display('Index:duty');
    }		
	    
		
		/**
		 * IndexAction::panel()
		 * 
		 * @return
		 */
public function panel()
    {		
	checkLoginSession();
	$cnt = "pMain";
			if(isset($_GET['pl']))
			{	
			$cnt = $_GET['pl'];
			}	
			else{
			setcookie('__NOW_APP',"",time() - 3600,'/');		
			}
			$init= (function_exists('init_'.$cnt)?('init_'.$cnt):'doNothing');//变量做为函数名执行
			$arrayVa = $init();
			
			$this->assign('dbList',$arrayVa['a']);//返回一个数据列表或者空值
			$this->assign('page',$arrayVa['b']);//page
			//dump($init());
			header('Content-Type:text/html; charset=utf-8'); //防止出现乱码
			$this->assign('content', "Public:".$cnt);
			//dump($_SESSION['UserInfo']);
	    	$this->display('Public:panel');
    }
//接受菜单点击的参数    
    public function showContent()
    {
        $pagestr = isset($_GET['target'])?$_GET['target']:'index';
        $appstr = isset($_GET['app'])?$_GET['app']:'Public';
        $appPage = $appstr.':'.$pagestr;
        $this->display($appPage);    
    }    				
}
?>